<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3">交易明细</h1>
</div>
<div class="wrapper-md" ng-controller="tradeCtrl">
    <div class="panel panel-default">
        <div class="panel-heading">
            交易明细
        </div>
        <div class="panel-body b-b b-light">
            条数:
            <select class="input-sm form-control w-sm inline v-middle" ng-model="search_obj.pageSize">
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="30">30</option>
                <option value="40">40</option>
                <option value="50">50</option>
            </select>

            交易方式:
            <select class="input-sm form-control w-sm inline v-middle" ng-model="search_obj.payType">
                <option value="cz">充值</option>
                <option value="zz">转账</option>
                <option value="tx">提现</option>
                <option value="jj">奖金</option>
                <option value="hk">划扣</option>
            </select>

            开始时间:
            <div class="inline v-middle">
                <input type="text" class="input-sm form-control" date-time ng-model="search_obj.startTime" view="hours" date-change="changeDate"
                    format="YYYY-MM-DD HH:mm">
            </div>
            结束时间:
            <div class="inline v-middle">
                <input type="text" class="input-sm form-control" date-time ng-model="search_obj.endTime" view="hours" date-change="changeDate"
                    format="YYYY-MM-DD HH:mm">
            </div>

            <!-- 订单状态:
            <select class="input-sm form-control w-sm inline v-middle" ng-model="search_obj.status">
                <option value="">全部</option>
                <option value="0">失败</option>
                <option value="1">成功</option>
            </select> -->
            <button class="btn btn-sm btn-default" ng-click="searchFun()">搜索</button>
        </div>
        <div>
            <!-- 充值 -->
            <table class="table m-b-none" ng-if="search_obj.payType=='cz'">
                <thead>
                    <tr>
                        <th>
                            ID
                        </th>
                        <th>
                            订单号
                        </th>
                        <th>
                            充值账户
                        </th>
                        <th>
                            金额
                        </th>
                        <th>
                            交易状态
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            备注
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in pageData">
                        <td>
                            {{item.id}}
                        </td>
                        <td>{{item.orderNo}}</td>
                        <td>
                            {{item.username}}
                        </td>
                        <td>
                            <span ng-if="search_obj.payType=='cz'">+</span>
                            <span ng-if="search_obj.payType=='tx'">-</span>
                            {{item.money}}元
                        </td>
                        <td>{{item.status | statusFilter}}</td>
                        <td>{{item.createtime | date : 'yyyy-MM-dd hh:mm:ss'}}</td>
                        <td>
                            {{item.submitRemark}}
                        </td>
                    </tr>
                </tbody>
                <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="8" class="text-center">
                            <tm-pagination conf="paginationConf" ng-if="paginationConf"></tm-pagination>
                        </td>
                    </tr>
                </tfoot>
            </table>

            <!-- 提现 -->
            <table class="table m-b-none" ng-if="search_obj.payType=='tx'">
                <thead>
                    <tr>
                        <th>
                            ID
                        </th>
                        <th>
                            订单号
                        </th>
                        <th>
                            提现账户
                        </th>
                        <th>
                            金额
                        </th>
                        <th>
                            交易状态
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            备注
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in pageData">
                        <td>
                            {{item.id}}
                        </td>
                        <td>{{item.orderNo}}</td>
                        <td>{{item.username}}</td>
                        <td>
                            <span ng-if="search_obj.payType=='cz'">+</span>
                            <span ng-if="search_obj.payType=='tx'">-</span>
                            {{item.money}}元
                        </td>
                        <td>{{item.status | statusFilter}}</td>
                        <td>{{item.createtime | date : 'yyyy-MM-dd hh:mm:ss'}}</td>
                        <td>
                            {{item.remarkSubmit}}
                        </td>
                    </tr>
                </tbody>
                <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="5" class="text-center">
                            <tm-pagination conf="paginationConf" ng-if="paginationConf"></tm-pagination>
                        </td>
                    </tr>
                </tfoot>
            </table>

            <!-- 奖金 -->
            <table class="table m-b-none" ng-if="search_obj.payType=='jj'">
                <thead>
                    <tr>
                        <th>
                            ID
                        </th>

                        <th>
                            金额
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            谁的奖金
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in pageData">
                        <td>
                            {{item.id}}
                        </td>
                        <td>
                            + {{item.money}}元
                        </td>
                        <td>{{item.createtime | date : 'yyyy-MM-dd hh:mm:ss'}}</td>
                        <td>{{item.username}}</td>
                    </tr>
                </tbody>
                <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="5" class="text-center">
                            <tm-pagination conf="paginationConf" ng-if="paginationConf"></tm-pagination>
                        </td>
                    </tr>
                </tfoot>
            </table>

            <!-- 划扣 -->
            <table class="table m-b-none" ng-if="search_obj.payType=='hk'">
                <thead>
                    <tr>
                        <th>
                            ID
                        </th>
                        <th>
                            为谁注册
                        </th>
                        <th>
                            金额
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            谁注册
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in pageData">
                        <td>
                            {{item.id}}
                        </td>
                        <th>
                            {{item.username}}
                        </th>
                        <td>
                            -{{item.advance}}元
                        </td>
                        <td>{{item.createtime | date : 'yyyy-MM-dd hh:mm:ss'}}</td>
                        <td>
                            {{item.huakouren}}
                        </td>
                    </tr>
                </tbody>
                <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="6" class="text-center">
                            <tm-pagination conf="paginationConf" ng-if="paginationConf"></tm-pagination>
                        </td>
                    </tr>
                </tfoot>
            </table>


            <!-- 转账 -->
            <table class="table m-b-none" ng-if="search_obj.payType=='zz'">
                <thead>
                    <tr>
                        <th>
                            ID
                        </th>
                        <th>
                            订单号
                        </th>
                        <th>
                            金额
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            谁转账
                        </th>
                        <th>
                            -》
                        </th>
                        <th>
                            转账给
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in pageData">
                        <td>
                            {{item.id}}
                        </td>
                        <th>
                            {{item.orderNo}}
                        </th>
                        <td>
                            -{{item.money}}元
                        </td>
                        <td>{{item.createtime | date : 'yyyy-MM-dd hh:mm:ss'}}</td>
                        <td>
                            {{item.username}}
                        </td>
                        <td>
                            --》
                        </td>
                        <td>
                            {{item.payee}}
                        </td>
                    </tr>
                </tbody>
                <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="6" class="text-center">
                            <tm-pagination conf="paginationConf" ng-if="paginationConf"></tm-pagination>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>